<template>
    <view>
        <navBar ref="navBar" :options="navigationBarOptions" @navBarLoad="handleNavBarLoad" fullscreen></navBar>
        <tl-button @getuserinfo="handleGetUserInfo" class="start_game_btn" openType="getUserInfo" isLogin>授权登录
        </tl-button>
        <footerBar ref="footerBar" @footerBarLoad="handleFooterBarLoad"></footerBar>
    </view>
</template>

<script>
    import UserOperatingMixins from '@u/Login/UserOperatingMixins.js';
    import {AzmComponent} from '@u/component.js';

    // 与navBar 配合使用，实现自定义顶部
    const AzmComponentMixins = AzmComponent({
        navigationBarOptions: {
            title: '模板',
            isBack: true
        },
        /**
         * 回退监听
         */
        onBackPress() {

        }
    })
    export default {
        components: {},
        mixins: [AzmComponentMixins, UserOperatingMixins],
        computed: {},
        data() {
            return {
                navBarTop: 45,
                footerBarTop: 50,
            }
        },
        watch: {},
        async onLoad() {
            // 传参案例（包含外部带参，依赖AzmComponent）
            this.branch_type = this.$$$getQuery("branch_type", 0, "number")
            this.id = this.$$$getQuery("id")

            // 动态设置
            // await this.$$$setNavigationBarTitle({title: "123"})
        },
        methods: {
            // 接口请求案例
            async loadData() {
                //#ifdef MP-WEIXIN
                this.$loading.show()
                const result = await this.$ajax.User.getWxSessionKey()
                this.$loading.hide()
                if (result.code !== 0) this.$toast.text(result.message)
                //#endif
            },
        }
    }
</script>

<style scoped lang="scss">
    .start_game_btn {
        position: fixed;
        top: 35%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
</style>
